<{include file="../templates/front/header.html"}>
<{include file="../templates/front/left.html"}>

<script type="text/javascript" src="../js/jquery.js">
</script>

<style>
dl{clear:left;}
dt,dd{float:left;}
.current {
	color: #ffffff;
	background-color: #ff6600;
}
</style>

<style type="text/css">  

a:link { text-decoration: none !important; }
.pagination {  
    font-family: Tahoma;  
    height: 25px;  
    left: 50%;  
    padding: 30px 0 20px;  
    position: relative;  
}  
.page-bottom {  
    left: -50%;  
    position: relative;  
}  
.pagination .page-cur, .pagination .page-crt {  
    background-color: #FFEEE5;  
    border: 1px solid #FF5500;  
    color: #FF5500;  
    font-weight: 700;  
}  
.pagination a, .pagination .page-start, .pagination .page-end {  
    background-color: #FFFFFF;  
    border: 1px solid #CCCCCC;  
}  

/* .pagination a:visited{  
    background-color: #FFFFFF;  
    border: 1px solid #ff5500; 
	!important; 
}  */
.pagination a:hover{  
    background-color: #FFFFFF;  
    border: 1px solid #ff5500;  
}  

.pagination a, .page-info, .page-start, .page-end, .page-break, .page-skip, .page-cur, .page-crt {  
    float: left;  
    font-family: Arial,SimSun;  
    font-size: 13px;  
    height: 23px;  
    line-height: 23px;  
    margin-right: 5px;  
    min-width: 15px;  
    overflow: hidden;  
    padding: 0 5px;  
    text-align: center;  
    vertical-align: middle;  
    white-space: nowrap;  
}  
</style> 

<script type="text/javascript">
$().ready(function() {
	var $productForm = $("#productForm");
	var $filter = $("#filter dl");
	var $attribute = $("#filter a.attribute");
	var $sorts = $("#sortDiv a");
	var $sort = $("#sort");
	var $pages = $("#pages a");
	var $skip = $("#skip");
	var $all = $("#filter a.all");
	$all.click(function(){
		alert("xxx");
	});

	$attribute.click(function() {
		var $this = $(this);
		if ($this.hasClass("current")) {
			$this.closest("dl").find("input").attr("disabled", "disabled");
		} else {
			$this.closest("dl").find("input").removeAttr("disabled").val($this.text());
		}
		$productForm.submit();
		return false;
	});
	
	$sorts.click(function(){
		var $this = $(this);
		if($this.attr('name') == 'shop_price'){
			if($sort.val() != 'shop_price+asc' && $sort.val() != 'shop_price+desc'){
				$sort.val('shop_price+asc');
			}else if($sort.val() == 'shop_price+asc'){
				$sort.val('shop_price+desc');
			}else if($sort.val() == 'shop_price+desc'){
				$sort.val('shop_price+asc');
			}
		}else if($sort.val() == 'sales'){
			
		}else if($sort.val() == 'discuss'){
			
		}
		
		$productForm.submit();  
		return false;
	});
	
	$pages.click(function(){
		var $this = $(this);
		var pageNow = $("#pageNow").val();

		if($this.html() == '上一页'){
			$("#pageNow").val(pageNow - 1);
		}else if($this.html() == '下一页'){
			var pageNow = pageNow * 1 + 1;
			$("#pageNow").val(pageNow);
			console.log($("#pageNow").val());
		}else if($this.html() == '首页'){
			var firstPage = $("#firstPage").val();
			$("#pageNow").val(firstPage);
		}else if($this.html() == '尾页'){
			var lastPage = $("#lastPage").val();
			$("#pageNow").val(lastPage);
		}else{
			$("#pageNow").val($this.html());
		}
			
		$productForm.submit();
		return false;
	});
	
	$skip.click(function(){
		var $this = $(this);
		var pageCount = $("#pageCount").val();
		
		var jumpto = $("#jumpto").val();
		
		if(isNaN(jumpto)){
			$("#pageNow").val(1);
		}else if(Math.floor(jumpto) > pageCount){
			$("#pageNow").val(pageCount);
		}else{
			$("#pageNow").val(Math.floor(jumpto));
		}
		
		$productForm.submit();
		return false;
	});
	
});
</script>

	<div id="pageRight" class="fr">
	    <div class="ur_here blank">
	    	<{$ur_here}>
		</div>
		<form id="productForm" action="category.php?act=sort" method="post">
			<div class="mod1 blank" id="filter" class="filter">
			<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>
			<h1 class="mod1tit">商品筛选</h1>
				<div class="mod1con">
					<input type="hidden" name="cat_id" value="<{$cat_id}>"/>
					<input type="hidden" name="pageNow" id="pageNow" value="<{$pageNow}>"/>
					<input type="hidden" id="firstPage" value="<{$firstPage}>"/>
					<input type="hidden" id="lastPage" value="<{$lastPage}>"/>
					<{foreach from=$cat_attrs item=attrs}>
					<dl>
						<div class="screeBox">
							<dt>
								<input type="hidden" name="<{$attrs.attr_id}>" <{if $attrs.selected eq ''}> disabled="true" <{else}> value="<{$attrs.selected}>"<{/if}>/>
								<strong><{$attrs.attr_name}>：</strong>
								<p>全部</p>
							</dt>
							<a href="javascript:;"></a>&nbsp;
							<{foreach from=$attrs.attr_values item=attr_value key=key}>
							<dd>
			 	  				<a href="javascript:;" <{if $attrs.selected eq $attr_value}> class="attribute  current" title="点击取消" <{else}> class="attribute" <{/if}> ><{$attr_value}></a>&nbsp;
			 	  			</dd>
							<{/foreach}>
						</div>
					</dl>
					<{/foreach}>
				</div>
			</div>
			<div id="sortDiv" class="goodsTitle clearfix blank" style="width:742px;height:35px;margin:5; background:indigo; vertical-align:middle">
				<input id="sort" type="hidden" name="sort" value="<{$sort_value}>">
				<div style="float:left; margin-top:6px; margin-right:10px; display:inline">
					默认排序：
				</div>
				<div style="float:left; margin-top:5px; margin-right:10px; display:inline">
					<a href="javascript:;" name="shop_price"><img src="../templates/front/images/price<{if $sort.0 eq shop_price}><{$sort.1}><{/if}>.jpg" alt=""></a>				
				</div>
				<div style="float:left; margin-top:5px; margin-right:10px; display:inline">
					<a href="javascript:;" name="sales"><!-- <img src="../templates/front/images/priceasc.jpg" alt="按价格排序"> --></a>
				</div>
				<div style="float:left; margin-top:5px; margin-right:10px; display:inline">
					<a href="javascript:;" name="discuss"><!-- <img src="../templates/front/images/pricedesc.jpg" alt="按更新时间排序"> --></a>
				</div>
			</div>
		</form>
		
		<div class="clearfix modContent">
			<div class="clearfix grid">
				<{foreach from=$goods_list item=good}>
				<div class="goodsbox">
					<div class="imgbox"><a href="goods.php?goods_id=<{$good.goods_id}>"><img src="../<{$good.goods_thumb}>" /></a>
					</div>
					<a href="goods.php?goods_id=<{$good.goods_id}>"><{$good.goods_name}></a><br />
					<b class="f1">￥<{$good.shop_price}></b> 
				</div>
				<{/foreach}>
			</div>
		</div>
		
		<div class="pagination">  
	  		<div class="page-bottom" id="pages">  
		   		<{$navigate}>
				<span class="page-skip">
				    <!-- <form id="filterPageForm" name="filterPageForm" method="get" action="goods_type.php?<{if $action eq 'search'}>act=search<{else}>act=list<{/if}>"> -->
				        当前第<{$pageNow}>页&nbsp;共<{$pageCount}>页 到第<input type="text" title="指定页码" name="id" id="jumpto" size="3" value="">页
				        <input type="hidden" value="<{$pageCount}>" id="pageCount"/>
				        <button title="指定页码" type="submit" id="skip">确定</button>  
				   <!--  </form>  -->
				</span>     
		 	</div>  
		</div>						
		
	</div>
</div>


<div class="blank"></div>



<div class="blank"></div>

<div class="block blank" >
	<div class="mod1 mod2" id="links" style=" border-top: 1px solid #ccc">
		<span class="lt"></span><span class="lb"></span><span class="rt"></span><span class="rb"></span>  
	</div>
	<script type="text/javascript">divheight("links");</script>	
</div> 
<div class="block tc" style="">
	<img src="../templates/front/images/fot_img0.gif">
</div>
<div class="block tc" style="margin-bottom:20px;">
	<a href="#" >免责条款</a> | 
       <a href="#" >隐私保护</a> | 
       <a href="#" >咨询热点</a> | 
       <a href="#" >联系我们</a> | 
       <a href="#" >公司简介</a> | 
       <a href="#" >批发方案</a> | 
       <a href="#" >配送方式</a> 
	<br />
	&copy; 2013/10 JDSHOP 版权所有，并保留所有权利。
	<br />
	<a href="#" style="display:none;"></a>
	<br />
</div>
	
</body>
</html>

